%% Temple university CIS 2033
% A modern Introduction to Probability and Statistics
% Chapter 12: The Poisson process
%
% Author: Djordje Gligorijevic
% email: gligorijevic@temple.edu
%
% Special thanks to Min Xiao (http://astro.temple.edu/~tud09663/index.html)
% for given examples and ideas for lab examples.

%% Excercise 1: 

load jankahardness.txt

figure;
scatter(jankahardness(:,1), jankahardness(:,2));
xlabel('Wood density')
ylabel('Hardness')
title('Scatterplot of Janka hardness versus density of wood')
hold on;

theta = regress(jankahardness(:,2),jankahardness(:,1));

plot(jankahardness(:,1), jankahardness(:,1)'*theta, '--g')

